package de.reondo.jos;

import org.jgrapht.WeightedGraph;

public class JarGraphStyler implements IGraphStyler<String, JarDependencyEdge> {

    @SuppressWarnings("unused")
    private WeightedGraph<String, JarDependencyEdge> graph;

    public JarGraphStyler(WeightedGraph<String, JarDependencyEdge> g) {
        this.graph = g;
    }
    
    @Override
    public String getColorForVertex(String vertex) {
        return "2";
    }

    @Override
    public String getVertexLabel(String vertex) {
        return vertex;
    }

    @Override
    public String getEdgeLabel(JarDependencyEdge edge) {
        // I had a look into the source of DefaultWeightedEdge and AbstractBaseGraph,
        // the graph takes the weight from the edge, so no need to call
        // graph.getEdgeWeight(edge) here.
        return ""+edge.getEdgeWeight();
    }

}
